﻿using System;
using System.Collections.Generic;
using System.Drawing;
using EnvDTE;
using EnvDTE80;
using Microsoft.LiveFX.Client;
using Microsoft.LiveFX.ResourceModel;

namespace LiveFrameworkExplorer.Plugins
{
    public interface ILFEBase
    {
        void DisplayObjectInPropertiesWindow(object objectToDisplay);
        string GetLiveMeshAuthentificationToken();
        string GetLiveMeshServiceUri();
        void DisplayException(IPlugin source, Exception ex);
        void DisplayException(IPlugin source, string message, Exception ex);
        void WriteToLFEOutput(string text);
        void OpenURL(string url);
        void ReloadLFE();
        void Refresh<TMeshItem, TResource>()
            where TMeshItem : LiveItem<TResource>, new()
            where TResource : Resource, new();
        Window CreateWindowToolbox(IPlugin sender, string progId, string title, ref object window);
        Window CreateWindowToolbox(IPlugin sender, string progId, string title, string guidPos, ref object window);
        DTE2 GetDTEEnvironment();
        LiveOperatingEnvironment GetLiveOperatingEnvironment();
    }

    public interface IPlugin
    {
        void Init(ILFEBase lfeBase);
    }

    public interface IPluginBar : IPlugin
    {
        string GetPluginLabel();
        Image GetPluginImage();
        void OpenPlugin();
        PluginBarStatus QueryStatus(LFEState state);
    }

    public interface IPluginItem : IPlugin
    {
        List<Type> GetTypes();
        string GetMenuItemLabel();
        Image GetMenuItemImage();
        bool CheckItem<TMeshItem, TResource>(object item)
            where TMeshItem : LiveItem<TResource>, new()
            where TResource : Resource, new();
        void OpenPlugin<TMeshItem, TResource>(object item, object parentItem)
            where TMeshItem : LiveItem<TResource>, new()
            where TResource : Resource, new();
    }
}
